﻿using System.Collections.Generic;

namespace Mozi.Live.SDP
{
    /// <summary>
    /// 时间描述信息
    /// </summary>
    public class SDPTimeDescription
    {
        /// <summary>
        /// 会话的媒体时间区间 起算为1900-01-01T00:00:00Z
        /// </summary>
        public SDPTimeActive TimeActive { get; set; }
        /// <summary>
        /// 重复信息
        /// </summary>
        public List<SDPRepeatTime> TimeRepeats { get; set; }
        /// <summary>
        /// 转为字符串
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            List<string> ls = new List<string>();
            ls.Add($"t={TimeActive}");
            if (TimeRepeats != null)
            {
                foreach (var r in TimeRepeats)
                {
                    ls.Add($"r={r}");
                }
            }
            return string.Join("\r\n", ls);
        }

    }

}
